(*
  Copyright (c) 2009 Barry Schwartz

  Permission is hereby granted, free of charge, to any person
  obtaining a copy of this software and associated documentation
  files (the "Software"), to deal in the Software without
  restriction, including without limitation the rights to use,
  copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the
  Software is furnished to do so, subject to the following
  conditions:

  The above copyright notice and this permission notice shall be
  included in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  OTHER DEALINGS IN THE SOFTWARE.
*)

module Camomile : CamomileLibrary.Type

module UniChar:
sig
  type t
  val eq : t -> t -> bool
  val compare : t -> t -> int
  val of_int : int -> t
  val to_int : t -> int
  val int_of : t -> int                 (* A synonym for |to_int| *)
end

module UniString :
sig
  module type T =
  sig
    include Camomile.UnicodeString.Type
    val append : t -> t -> t
  end

  module type S =
  sig
    type t
    val of_string : ?encoding:string -> string -> t
    val to_string : ?encoding:string -> t -> string
    val string_of : ?encoding:string -> t -> string
    val of_ints : int array -> t
    val to_ints : t -> int array
    val ints_of : t -> int array
    val of_int_list : int list -> t
    val to_int_list : t -> int list
    val int_list_of : t -> int list
    val of_uniChars : UniChar.t array -> t
    val to_uniChars : t -> UniChar.t array
    val uniChars_of : t -> UniChar.t array
    val of_uniChar_list : UniChar.t list -> t
    val to_uniChar_list : t -> UniChar.t list
    val uniChar_list_of : t -> UniChar.t list
    val of_glyph_name_string : string -> t
    val of_glyph_name : t -> t
    val empty  : t
    val length : t -> int
    val append : t -> t -> t
    val get    : t -> int -> UniChar.t
    val pythonize : t -> Pycaml.pyobject
    val unpythonize : ?encoding:string -> Pycaml.pyobject -> t
  end

  module Make : functor (Text : T) -> S with type t = Text.t
end

module UniText : UniString.S with type t = Camomile.UText.t
